package com.abing.starry.controller;

import cn.hutool.core.util.RandomUtil;
import com.abing.starry.common.BaseResponse;
import com.abing.starry.common.QueryParamEntity;
import com.abing.starry.common.ResultUtils;
import org.springframework.web.bind.annotation.*;

/**
 * @Author CaptainBing
 * @Date 2024/8/23 13:05
 * @Description
 */
@RestController
@RequestMapping("/simulator")
public class SimulatorController {

    @GetMapping("/get")
    public BaseResponse<String> get(@RequestParam(required = false) String name,
                                   @RequestBody(required = false) QueryParamEntity queryParamEntity){
        return ResultUtils.success("name:" + name + " " + "queryParamEntity:" + queryParamEntity);
    }

    @GetMapping("/random/string")
    public BaseResponse<String> getRandomString(@RequestParam(required = false,defaultValue = "10") Integer length){
        return ResultUtils.success(RandomUtil.randomString(length));
    }


}
